<link rel="stylesheet" type="text/css" href="css/calendar.css" property="stylesheet"/>
<div id="calendar">
  <button id="clearFilters">Clear All Filters</button>
  <button id="showAll">Show All Weeks</button>
  <button id="hideAll">Hide All Weeks</button>
  <button id="toggleAll">Toggle All Weeks</button>
  <span class="info">{{ v.caption }}</span>
  {% autoescape off %}
  {% for week, assignments in v.calendar %}
  <table>
    <thead class="weekHead {% ifequal 0 assignments|length %}{% else %}hasAssignments{% endifequal %} month{{ week.month }}" data-week="{{ week }}" >
      <tr class="weekSummary">
	<th colspan="4" style="min-width:400px">{{ week }}</th>
	<th>Volunteers: <span class="volunteers">{{ assignments|length }}</span></th>
	<th>Starts: <span class="starts"></span></th>
	<th>Finishes: <span class="finishes"></span></th>
      </tr>{#{% ifequal assignments|length 0 %}#}
    {#</thead>{% else %}#}
      <tr class="assignmentHeadings">
	<th>project</th>
	<th>code</th>
	<th>volunteer</th>
	<th>start</th>
	<th>end</th>
	<th>remaining</th>
	<th>partner</th>
      </tr>
    </thead>
    <tbody class="weekList" data-week="{{ week }}" data-starts="0" data-finishes="0">{% for assignment in assignments %}
      <tr data-assignment="{{ assignment.key }}" data-project="{{ assignment.project_name }}" data-partner="{{ assignment.partner_name }}" class="assignment{% ifchanged assignment.project_name %} start_project {% cycle  'projEven' 'projOdd' as project_set %} {% else %} {{ project_set }} {% endifchanged %}">
	<td class="project_name" data-project="{{ assignment.project_name }}">{{ assignment.project_name }}</td>
	<td class="code" data-startdate="{{ assignment.start_date.date }}" data-enddate="{{ assignment.end_date.date }}" data-week="{{ week }}"></td>
	<td class="volunteer_name" data-volunteer="{{ assignment.volunteer_name }}">{{ assignment.volunteer_name }}</td>
	<td>{{ assignment.start_date.date }}</td>
	<td>{{ assignment.end_date.date }}</td>
	<td style="/*width:50px;text-align:center*/" class="weeksRemaining" data-endyear="{{ assignment.end_date.date.year }}" data-endmonth="{{ assignment.end_date.date.month }}" data-endday="{{ assignment.end_date.date.day }}" data-weekyear="{{ week.year }}" data-weekmonth="{{ week.month }}" data-weekday="{{ week.day }}">
	</td>
	<td class="partner_name" data-partner="{{ assignment.partner_name }}">{{ assignment.partner_name }}</td>
      </tr>{% endfor %}
    </tbody>{#{% endifequal %}#}
  </table>{% endfor %}{% endautoescape %}
</div>
<script type="text/javascript" src="/js/calendar.js"></script>





		
